
public class Passenger {
	
	private String firstName;
	private String lastName;
	private String passportNo;
	private String passportCountry;
	
	private long passengerID;
	
	private boolean idSet = false;

	public Passenger(String passportNo, String passportCountry) {
		this.passportNo = passportNo;
		this.passportCountry = passportCountry;
	}
	
	public Passenger(String passportNo, String passportCountry, String firstName, String lastName) {
		this(passportNo,passportCountry);
		
		this.firstName = firstName;
		this.lastName = lastName;
	}
	
	
	
	/**
	 * @param firstName the firstName to set
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	/**
	 * @return the firstName
	 */
	public String getFirstName() {
		return firstName;
	}

	/**
	 * @param lastName the lastName to set
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	/**
	 * @return the lastName
	 */
	public String getLastName() {
		return lastName;
	}

	/**
	 * @param passportNo the passportNo to set
	 */
	public void setPassportNo(String passportNo) {
		this.passportNo = passportNo;
	}

	/**
	 * @return the passportNo
	 */
	public String getPassportNo() {
		return passportNo;
	}

	/**
	 * @param passportCountry the passportCountry to set
	 */
	public void setPassportCountry(String passportCountry) {
		this.passportCountry = passportCountry;
	}

	/**
	 * @return the passportCountry
	 */
	public String getPassportCountry() {
		return passportCountry;
	}

	/**
	 * @param passengerID the passengerID to set
	 */
	public void setPassengerID(long passengerID) {
		this.passengerID = passengerID;
		idSet = true;
	}

	/**
	 * @return the passengerID
	 */
	public long getPassengerID() {
		return passengerID;
	}

	/**
	 * @return the idSet
	 */
	public boolean isIdSet() {
		return idSet;
	}
	
	@Override
	public boolean equals(Object pas) {
		if (pas instanceof Passenger) {
			Passenger pasOther = (Passenger) pas;
			if ((pasOther.passportNo.equals(passportNo)) && (pasOther.passportCountry.equals(passportCountry))) {
				return true;
			}
		}
		return false;
	}

    @Override
    public int hashCode() {
        return passportNo.hashCode() ^ passportCountry.hashCode();
    }

}

